<?php

namespace App\Think;
use App\Think\Redis;

class Cache
{
    
    public static function set($key, $value, $timeout=0){
    	$cls = Redis::init();
    	return $cls->set($key, json_encode($value), $timeout);
    }

    public static function get($key){
    	$cls = Redis::init();
    	return json_decode($cls->get($key), true);
    }

}
